package susano.demo.action.company;

import java.util.List;
import java.util.logging.Logger;

import susano.common.util.BeanMap;
import susano.demo.service.company.EmployeeService;
import susano.presen.controller.Action;
import susano.presen.controller.Navigation;
import susano.presen.util.DownloadUtil;

public class ListEmployeeAjaxAction extends Action {

	protected static Logger logger = Logger
			.getLogger(ListEmployeeAjaxAction.class.getName());

	protected EmployeeService employeeService = new EmployeeService();

	@Override
	protected Navigation execute() {
		List<BeanMap> emps = employeeService.findAll(asString("parent"));
		if (emps == null) {
			return null;
		}
		DownloadUtil.downloadJSON(request, response, emps);
		return null;
	}

	@Override
	protected Navigation init() {
		return null;
	}

	@Override
	protected Navigation validate() {
		return null;
	}

}
